package com.cbtx.module.common.bean;

import android.text.TextUtils;

import com.google.gson.Gson;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * author : joker.peng
 * e-mail : joker@fiture.com
 * date   : 2021/6/11 2:07 PM
 * desc   :
 */
public class GoodsEntity implements Serializable {


    public String code;
    public String msg;
    public DataBean data;

    public static class DataBean implements Serializable {
        public int total;
        public int pageNum;
        public int pageSize;
        public int size;
        public int startRow;
        public int endRow;
        public int pages;
        public int prePage;
        public int nextPage;
        public boolean isFirstPage;
        public boolean isLastPage;
        public boolean hasPreviousPage;
        public boolean hasNextPage;
        public int navigatePages;
        public int navigateFirstPage;
        public int navigateLastPage;
        public int lastPage;
        public int firstPage;
        public List<ListBean> list;
        public List<Integer> navigatepageNums;

        public static class ListBean implements Serializable {
            public String imageSmall;
            public String goodsMember;
            public String img;
            public String serialNumber;
            public String coverImg;
            public String introduce;
            public int num;
            public String certificate;
            public int type;
            public int shopsId;
            public String years;
            public String specs;
            public int visits;
            public long createTime;
            public String insurancePrice;
            public int price;
            public String category;
            public String goodsName;
            public int status;
            public Object commend;
            public Object goodsId;

            public ArrayList<String> getImageList() {

                ArrayList<String> images = new ArrayList<>();
                if (!TextUtils.isEmpty(img)) {
                    ImageMore imageMore = new Gson().fromJson(img, ImageMore.class);

                    images.addAll(imageMore.more);
                }

                return images;
            }

            public class ImageMore {
                public ArrayList<String> more;
            }


        }
    }
}